.task-dialog {
  :deep(.el-dialog__body) {
    padding: 0;
  }

  :deep(.el-dialog__header) {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #ebeef5;
    background: #f5f7fa;
  }

  :deep(.el-dialog__title) {
    font-size: 18px;
    font-weight: 500;
    color: #303133;
  }

  :deep(.el-dialog__headerbtn) {
    top: 20px;
  }

  &-send {
    :deep(.el-form-item__content) {
      display: block;
    }
  }

  .task-form {
    padding: 0 24px;
    background: #fff;

    .el-form-item {
      margin-bottom: 10px;

      &:last-child {
        margin-bottom: 0;
      }

      :deep(.el-form-item__label) {
        font-weight: 500;
        color: #303133;
        padding-right: 16px;
      }

      :deep(.el-form-item__content) {
        .el-input__wrapper,
        .el-textarea__inner {
          box-shadow: 0 0 0 1px #dcdfe6 inset;
          transition: all 0.3s;

          &:hover {
            box-shadow: 0 0 0 1px #c0c4cc inset;
          }

          &:focus {
            box-shadow: 0 0 0 1px #409eff inset;
          }
        }
      }
    }

    .material-section {
      .material-options {
        display: flex;
        gap: 24px;
        align-items: center;

        .el-radio-group {
          display: flex;
          gap: 24px;

          :deep(.el-radio) {
            margin-right: 13px;
          }
        }

        .el-date-picker {
          width: 240px;
        }
      }
    }

    .target-section {
      .target-actions {
        margin-bottom: 10px;
        display: flex;
        gap: 12px;

        .el-button {
          padding: 8px 16px;
        }
      }

      .target-preview {
        background: #f5f7fa;
        padding: 10px 16px;
        border-radius: 8px;
        border: 1px solid #e4e7ed;
        margin: 10px 0;

        .target-group {
          margin-bottom: 5px;

          &:last-child {
            margin-bottom: 0;
          }

          .target-label {
            font-size: 14px;
            color: #606266;
            margin-bottom: 0px;
            font-weight: 500;
          }

          .target-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;

            .target-item {
              margin: 0;
              padding: 0 8px;
              height: 28px;
              line-height: 26px;
              border-radius: 4px;
              background: #fff;
              border: 1px solid #dcdfe6;
              color: #606266;
              transition: all 0.3s;

              &:hover {
                border-color: #409eff;
                color: #409eff;
              }

              .el-icon {
                margin-left: 4px;
                font-size: 12px;
              }
            }
          }
        }
      }
    }
  }

  .selectSend {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 24px;

    .section-title {
      font-size: 16px;
      font-weight: 500;
      color: #303133;
      margin-bottom: 20px;
      padding-left: 12px;
      border-left: 4px solid #409eff;
    }

    .message-tabs {
      :deep(.el-tabs__header) {
        margin-bottom: 24px;
      }

      :deep(.el-tabs__nav) {
        border: none;
      }

      :deep(.el-tabs__item) {
        height: 40px;
        line-height: 40px;
        font-size: 14px;
        color: #606266;
        padding: 0 20px;

        &.is-active {
          color: #409eff;
          font-weight: 500;
        }
      }

      .el-form-item {
        margin-bottom: 24px;

        &:last-child {
          margin-bottom: 0;
        }

        :deep(.el-form-item__label) {
          font-weight: 500;
          color: #303133;
        }
      }

      .image-uploader,
      .video-uploader {
        border: 1px dashed #d9d9d9;
        border-radius: 8px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        width: 120px;
        height: 120px;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.3s;

        &:hover {
          border-color: #409eff;
          background: #f5f7fa;
        }

        .upload-icon {
          font-size: 28px;
          color: #8c939d;
          transition: all 0.3s;
        }

        &:hover .upload-icon {
          color: #409eff;
        }

        .preview-image {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }

        .preview-video {
          width: 100%;
          max-height: 178px;
        }
      }
    }

    .message-actions {
      margin-top: 20px;
      display: flex;
      justify-content: flex-end;
    }

    .message-preview-item-list {
      flex: 1;
      padding-right: 10px;
      padding: 10px;
      height: 90%;
      overflow: hidden;

      &::-webkit-scrollbar {
        width: 6px;
      }

      &::-webkit-scrollbar-thumb {
        background-color: #c0c4cc;
        border-radius: 3px;
      }

      &::-webkit-scrollbar-track {
        background-color: #f5f7fa;
      }

      .preview-title {
        font-size: 16px;
        font-weight: bold;
        color: #303133;
      }

      .message-preview-item-list {
        overflow-y: auto;
        padding-right: 10px;
        padding: 10px;
        &::-webkit-scrollbar {
          width: 6px;
        }
        &::-webkit-scrollbar-thumb {
          background-color: #c0c4cc;
          border-radius: 3px;
        }
        &::-webkit-scrollbar-track {
          background-color: #f5f7fa;
        }
      }

      .message-preview-item {
        margin-bottom: 10px;
        transition: all 0.3s;
        border: 1px solid #ebeef5;
        border-radius: 8px;
        overflow: hidden;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        :deep(.el-card__body) {
          padding: 16px !important;
        }

        .preview-header {
          display: flex;
          justify-content: space-between;
          align-items: flex-start;
          gap: 16px;

          .message-info {
            flex: 1;
            display: flex;
            align-items: flex-start;
            gap: 12px;

            .message-type-tag {
              padding: 4px 8px;
              border-radius: 4px;
              font-size: 12px;
              font-weight: 500;
              white-space: nowrap;
              flex-shrink: 0;

              &.text {
                background-color: #e6f7ff;
                color: #1890ff;
              }

              &.image {
                background-color: #f6ffed;
                color: #52c41a;
              }

              &.video {
                background-color: #fff7e6;
                color: #fa8c16;
              }

              &.link {
                background-color: #f9f0ff;
                color: #722ed1;
              }
            }

            .message-content {
              flex: 1;
              min-width: 0;
              font-size: 14px;
              color: #606266;
              word-break: break-all;
              white-space: pre-wrap;
              line-height: 2;

              .preview-image {
                max-width: 100px;
                max-height: 100px;
                border-radius: 8px;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
              }

              .preview-video {
                max-width: 100px;
                max-height: 100px;
                border-radius: 8px;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
              }
            }
          }

          .preview-actions {
            flex-shrink: 0;

            .action-buttons {
              display: flex;
              gap: 8px;
              align-items: center;

              .el-button {
                padding: 4px;

                &.is-disabled {
                  opacity: 0.5;
                  cursor: not-allowed;
                }

                .el-icon {
                  font-size: 16px;
                }
              }
            }
          }
        }
      }
    }
  }

  .dialog-footer {
    padding: 10px 24px;
    border-top: 1px solid #ebeef5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;

    .el-button {
      padding: 8px 20px;
    }
  }
}

.friend-selector,
.group-selector {
  .search-wrapper {
    margin-bottom: 16px;

    .search-input {
      :deep(.el-input-group__append) {
        padding: 0;
        background-color: #409eff;
        border-color: #409eff;

        .el-button {
          margin: 0;
          border: none;
          color: #fff;
          padding: 0 15px;
          height: 32px;

          &:hover {
            background-color: #66b1ff;
          }

          .el-icon {
            margin-right: 4px;
          }
        }
      }
    }
  }

  .el-table {
    margin-top: 16px;
  }
}

.image-uploader {
  width: 100px;
  height: 100px;
  border: 1px dashed #d9d9d9;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;

  &:hover {
    border-color: #409eff;
    background: #f5f7fa;
  }

  .upload-icon {
    font-size: 28px;
    color: #8c939d;
    transition: all 0.3s;
  }

  &:hover .upload-icon {
    color: #409eff;
  }

  .preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

:deep(.el-upload--picture-card) {
  width: 100px;
  height: 100px;
  line-height: 100px;
}

:deep(.el-upload-list--picture-card .el-upload-list__item) {
  width: 100px;
  height: 100px;
}

:deep(.el-overlay) {
  .task-dialog {
    --el-dialog-margin-top: 1vh !important;
  }
}

.message-content {
  .message-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;

    .message-type {
      margin-right: 8px;
    }

    .message-data {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

.target-info {
  .target-group {
    .target-label {
      font-size: 12px;
      color: #666;
      margin-bottom: 4px;
    }

    .target-list {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      align-items: center;
      .target-item {
        margin-right: 4px;
      }
    }
  }
}

.create-info {
  font-size: 12px;
  color: #666;

  div {
    margin-bottom: 4px;
  }
}

.message-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;

  .message-type-tag {
    margin: 2px;
  }
}

.message-type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;

  .message-type-tag {
    margin: 2px;
  }
}

.target-item {
  &.is-disabled {
    background-color: #f5f7fa;
    border-color: #e4e7ed;
    color: #c0c4cc;
    cursor: not-allowed;

    &:hover {
      border-color: #e4e7ed;
      color: #c0c4cc;
    }
  }
}

:deep(.el-overlay) {
  .message-preview-dialog {
    --el-dialog-margin-top: 5vh !important;
    height: 80vh;
    .el-dialog__body {
      flex: 1;
      overflow: hidden;
      padding: 24px;
      background: #f6f8fa;
      height: calc(80vh - 120px) !important;
    }
  }
}
.content-item {
  :deep(.el-form-item__content) {
    display: block;
  }
  .content-input-wrapper {
    position: relative;
    .emoji-trigger {
      position: absolute;
      right: 8px;
      top: 8px;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      border-radius: 4px;
      transition: all 0.3s;
      z-index: 2;

      &:hover {
        background-color: #f5f7fa;
      }

      .emoji-icon {
        font-size: 20px;
        color: #606266;
      }
    }
    .emoji-picker-container {
      background: #fff;
      border-radius: 8px;
      width: 350px;
      height: 400px;
      .emoji-picker {
        margin: 0;
        height: 100%;
        width: 100%;
      }
    }
  }
}
